#ifndef _BINARY_TREE_H
#define _BINARY_TREE_H

#define DEBUGMOD
#ifdef DEBUGMOD
#define LOG(s, ...) printf( "LOG:  [in founction: %s ] --"s, __FUNCTION__, ##__VA_ARGS__);
#else
#define LOG(s, ...)
#endif
#define NoneChr 'x'
#define ROW_WIDTH 10

typedef char elemType;
typedef enum{FALSE, TREE} BOOL;
typedef struct Nodestru *ptrNode, Node;
typedef struct Bintreestru *ptrBintree, BinaryTree;

struct Nodestru{
    elemType value;
    ptrNode lchild;
    ptrNode rchild;
};

struct Bintreestru{
    ptrNode root;
};
void bintree_create(ptrNode * node, elemType * array, int const n);
void bintree_postOrder(ptrNode node);
void bintree_inOrder(ptrNode node);
void bintree_preOrder(ptrNode node);
int bintree_depth(ptrNode node);
int bintree_leafcount(ptrNode node);
int bintree_rowOrder_arrayEndIndex(int * const array);
void bintree_rowOrder(ptrNode const node, ptrNode  (*rowArray)[ROW_WIDTH], int const row);
void bintree_rowOrder_show(ptrNode (*rowArray)[ROW_WIDTH]);
void row_PrintTest();
#endif // _BINARY_TREE_H
